package com.kyrie.lib_sys.rocketMQ.Consumer;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * 监听带Tag的消息示例
 *
 * @author heefM
 * @date 2025-
 */
@Component
@Slf4j
/**
 * 使用selectorExpression来选择Tag，* 代表所有Tag, "TagA || TagB" 代表TagA或TagB
 *
 * @author heefM
 * @date 2025-
 */
@RocketMQMessageListener(topic = "TestTopic", selectorExpression = "TagA", consumerGroup = "my-taga-consumer-group")
public class TagAMessageConsumer implements RocketMQListener<String> {

    @Override
    public void onMessage(String message) {
        log.info(">>>>>>>>>> 收到TagA的消息: {}", message);
    }
}
